<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <title>病历</title>
</head>
<style type="text/css">
    th.t1 {
        padding-top: 8px;
    }

    td.t1 {
        padding-top: 8px;
    }

    th.t2 {
        padding-bottom: 8px;
    }

    td.t3 {
        padding-bottom: 90px;
    }

    td.t4 {
        padding-top: 60px;
    }

    .PageNext {
        page-break-after: always;
    }

    p {
        font-family: "楷体";
        margin: 0;
    }
</style>
<style media="print" type="text/css">
    .noPrint {
        DISPLAY: none;
    }
</style>
<body>
<div style="width: 800px;margin-left:10mm" align="center">
    <div>
        <table width="800px">
            <tr>
                <th colspan="6" style="text-align:right">病历号:</th>
                <td colspan="2"><p th:text="${patient.medicalNumber}"></p></td>
            </tr>
            <tr>
                <th class="t1" colspan="8" style="align-content: center">
                    <p th:text="${account.accountName}"></p>
                </th>
            </tr>
            <tr>
                <th class="t1" colspan="8" style="align-content: center">
                    <label style="font-size: 24px">病历及治疗记录</label>
                </th>
            </tr>
            <tr>
                <th class="t1" width="8%" style="text-align: left">姓名:</th>
                <td class="t1" width="15%"><p th:text="${patient.name}"></p></td>
                <th class="t1" width="8%" style="text-align: left">性别:</th>
                <td class="t1" width="15%"><p th:text="${patient.sex == 1?'男':'女'}"></p></td>
                <th class="t1" width="8%" style="text-align: left">年龄:</th>
                <td class="t1" width="15%"><p th:text="${age}"></p></td>
                <th class="t1" width="12%" style="text-align: left">民族:</th>
                <td class="t1" width="15%">
                    <p th:if="${patient.ethnic==0}">汉族</p>
                    <p th:if="${patient.ethnic==1}">非汉族</p>
                    <p th:if="${patient.ethnic==2}">其他</p>
                </td>
            </tr>
            <tr>
                <th class="t1" style="text-align: left">职业:</th>
                <td class="t1">
                    <p th:if="${patient.job==0}">公司职员</p>
                    <p th:if="${patient.job==1}">运动员</p>
                    <p th:if="${patient.job==2}">演艺业</p>
                    <p th:if="${patient.job==3}">学生</p>
                    <p th:if="${patient.job==4}">记者</p>
                    <p th:if="${patient.job==5}">公务员</p>
                    <p th:if="${patient.job==6}">其他</p>
                </td>
                <th class="t1" style="text-align: left">婚姻:</th>
                <td class="t1">
                    <p th:if="${patient.marital==0}">未婚</p>
                    <p th:if="${patient.marital==1}">已婚</p>
                </td>
                <th class="t1" style="text-align: left">籍贯:</th>
                <td class="t1"><p th:text="${patient.origin}"></p></td>
                <th class="t1" style="text-align: left">文化程度:</th>
                <td class="t1">
                    <p th:if="${patient.culture==0}">小学</p>
                    <p th:if="${patient.culture==1}">初中</p>
                    <p th:if="${patient.culture==2}">高中</p>
                    <p th:if="${patient.culture==3}">大学</p>
                    <p th:if="${patient.culture==4}">研究生</p>
                    <p th:if="${patient.culture==5}">博士生</p>
                </td>
            </tr>
            <tr>
                <th class="t1" style="text-align:left" colspan="2">通讯地址及邮政编码:</th>
                <td colspan="6" class="t1"><p th:text="${patient.resident}"></p></td>
            </tr>
            <tr>
                <th class="t1" style="text-align: left">电话:</th>
                <td class="t1"></td>
                <th class="t1" style="text-align: center">手机:</th>
                <td class="t1" colspan="2"><p th:text="${patient.phone}"></p></td>
                <th class="t1" style="text-align: center">日期:</th>
                <td class="t1" colspan="2">
                    <p th:text="${#calendars.format(patient.creationTime,'yyyy-MM-dd')}"></p></td>
            </tr>
            <tr>
                <th class="t1 t2" style="text-align: left">主诉:</th>
                <td colspan="7">
                    <div th:each="zhuSu : ${zhuDiseaseRecords}">
                        <p th:text="${zhuSu.content}"></p>
                    </div>
                </td>
            </tr>
            <tr>
                <th style="text-align: left" colspan="8">现病史:</th>
            </tr>
            <tr th:each="zhuSu : ${zhuDiseaseRecords}">
                <td colspan="8" width="800px">
                    <div th:if="${!#strings.isEmpty(zhuSu.situation)}">
                        <label style="margin-left:0px;font-weight: 400">发病情况:</label>
                        <div style="margin-left:0px;white-space: pre-wrap;word-break:break-all;word-wrap:break-word"><p th:text="${zhuSu.situation}"></p></div>
                    </div>
                    <div th:if="${!#strings.isEmpty(zhuSu.symptom)}">
                        <label style="margin-left:0px;font-weight: 400">伴随症状:</label>
                        <div style="margin-left:0px;white-space: pre-wrap;word-break:break-all;word-wrap:break-word"><p th:text="${zhuSu.symptom}"></p></div>
                    </div>
                    <div th:if="${!#strings.isEmpty(zhuSu.process)}">
                        <label style="margin-left:0px;font-weight: 400">治疗经过:</label>
                        <div style="margin-left:0px;white-space: pre-wrap;word-break:break-all;word-wrap:break-word"><p th:text="${zhuSu.process}"></p></div>
                    </div>
                    <div th:if="${!#strings.isEmpty(zhuSu.state)}">
                        <label style="margin-left:0px;font-weight: 400">目前情况:</label>
                        <div style="margin-left:0px;white-space: pre-wrap;word-break:break-all;word-wrap:break-word"><p th:text="${zhuSu.state}"></p></div>
                    </div>
                    <div th:if="${!#strings.isEmpty(zhuSu.useSituation)}">
                        <label style="margin-left:0px;font-weight: 400">皮肤护理及护肤品使用情况:</label>
                        <div style="margin-left:0px;white-space: pre-wrap;word-break:break-all;word-wrap:break-word"><p th:text="${zhuSu.useSituation}"></p></div>
                    </div>
                    <div th:if="${!#strings.isEmpty(zhuSu.otherSituation)}">
                        <label style="margin-left:0px;font-weight: 400">其他情况:</label>
                        <div style="margin-left:0px;white-space: pre-wrap;word-break:break-all;word-wrap:break-word"><p th:text="${zhuSu.otherSituation}"></p></div>
                    </div>
                </td>
            </tr>
            <tr>
                <th style="text-align: left" colspan="8">既往史:</th>
            </tr>
            <tr th:each="jw : ${jwDiseaseRecords}">
                <td colspan="8" width="800px">
                    <div th:if="${!#strings.isEmpty(jw.situation)}">
                        <label style="margin-left:0px;font-weight: 400">发病情况:</label>
                        <div style="margin-left:0px;white-space: pre-wrap;word-break:break-all;word-wrap:break-word"><p th:text="${jw.situation}"></p></div>
                    </div>
                    <div th:if="${!#strings.isEmpty(jw.symptom)}">
                        <label style="margin-left:0px;font-weight: 400">伴随症状:</label>
                        <div style="margin-left:0px;white-space: pre-wrap;word-break:break-all;word-wrap:break-word"><p th:text="${jw.symptom}"></p></div>
                    </div>
                    <div th:if="${!#strings.isEmpty(jw.process)}">
                        <label style="margin-left:0px;font-weight: 400">治疗经过:</label>
                        <div style="margin-left:0px;white-space: pre-wrap;word-break:break-all;word-wrap:break-word"><p th:text="${jw.process}"></p></div>
                    </div>
                    <div th:if="${!#strings.isEmpty(jw.state)}">
                        <label style="margin-left:0px;font-weight: 400">目前情况:</label>
                        <div style="margin-left:0px;white-space: pre-wrap;word-break:break-all;word-wrap:break-word"><p th:text="${jw.state}"></p></div>
                    </div>
                    <div th:if="${!#strings.isEmpty(jw.useSituation)}">
                        <label style="margin-left:0px;font-weight: 400">皮肤护理及护肤品使用情况:</label>
                        <div style="margin-left:0px;white-space: pre-wrap;word-break:break-all;word-wrap:break-word"><p th:text="${jw.useSituation}"></p></div>
                    </div>
                    <div th:if="${!#strings.isEmpty(jw.otherSituation)}">
                        <label style="margin-left:0px;font-weight: 400">其他情况:</label>
                        <div style="margin-left:0px;white-space: pre-wrap;word-break:break-all;word-wrap:break-word"><p th:text="${jw.otherSituation}"></p></div>
                    </div>
                    <div th:if="${!#strings.isEmpty(jw.content)}">
                        <div style="margin-left:0px;white-space: pre-wrap;word-break:break-all;word-wrap:break-word"><p th:text="${jw.content}"></p></div>
                    </div>
                </td>
            </tr>
            <tr>
                <th style="text-align: left" colspan="8">家族史:</th>
            </tr>
            <tr>
                <td colspan="8" th:if="${familyHistoryRecords != null}">
                    <div th:if="${#strings.equals(familyHistoryRecords.isHavePatients,'1')}">
                        <label style="font-weight: 400">家中有类似的患者吗?</label>
                        <div style="margin-left:0px;"><p>有。<label
                                th:text="${ familyHistoryRecords.patientsDetails }"></label></p></div>
                    </div>
                    <div th:if="${#strings.equals(familyHistoryRecords.isHaveDisease,'1')}">
                        <label style="font-weight: 400">家族中有先天性或遗传性疾病吗?</label>
                        <div style="margin-left:0px;"><p>有。<label
                                th:text="${ familyHistoryRecords.diseaseDetails }"></label></p></div>
                    </div>
                    <div th:if="${#strings.equals(familyHistoryRecords.isHaveSpecialMedical,'1')}">
                        <label style="font-weight: 400">家族中有特殊的病历吗（如传染性疾病、代谢性疾病、免疫性疾病等）?</label>
                        <div style="margin-left:0px;"><p>有。<label
                                th:text="${ familyHistoryRecords.specialMedicalDetails }"></label></p></div>
                    </div>
                    <div th:if="${!#strings.isEmpty(familyHistoryRecords.otherDetails)}">
                        <label style="font-weight: 400">其他:</label>
                        <div style="margin-left:0px;"><p><label
                                th:text="${ familyHistoryRecords.otherDetails }"></label></p></div>
                    </div>
                </td>
            </tr>
            <tr>
                <th style="text-align: left" colspan="8">个人史:</th>
            </tr>
            <tr>
                <td height="10px" colspan="8" th:if="${personalHistoryRecords != null}">
                    <div th:if="${#strings.equals(personalHistoryRecords.isLactation,'0')}">
                        <label style="font-weight: 400">是否哺乳期?</label>
                        <div style="margin-left:0px;"><p>是。</p></div>
                    </div>
                    <div th:if="${#strings.equals(personalHistoryRecords.isGestation,'0')}">
                        <label style="font-weight: 400">是否妊娠期?</label>
                        <div style="margin-left:0px;"><p>是。</p></div>
                    </div>
                    <div th:if="${#strings.equals(personalHistoryRecords.isSmoke,'0')}">
                        <label style="font-weight: 400">是否抽烟?</label>
                        <div style="margin-left:0px;"><p>是。</p></div>
                    </div>
                    <div th:if="${#strings.equals(personalHistoryRecords.isPregnancy,'0')}">
                        <label style="font-weight: 400">是否怀孕或哺乳?</label>
                        <div style="margin-left:0px;"><p>是。</p></div>
                    </div>
                    <div th:if="${!#strings.isEmpty(personalHistoryRecords.otherDetails)}">
                        <label style="font-weight: 400">其他:</label>
                        <div style="margin-left:0px;"><p><label
                                th:text="${ personalHistoryRecords.otherDetails }"></label></p></div>
                    </div>
                </td>
            </tr>
            <tr>
                <th colspan="8" style="text-align: left">治疗区情况:</th>
            </tr>
            <tr>
                <td colspan="8">
                    <div style="margin-left:0px;" th:each="sc : ${skinChecks}"><p><label
                            th:text="${#calendars.format(sc.creationTime,'yyyy-MM-dd')}"></label>:&nbsp;&nbsp;
                        <label th:text="${sc.result}"></label>
                    </p></div>
                </td>
            </tr>
            <tr>
                <td colspan="8">
                    <table align="left" width="100%">
                        <tr>
                            <th style="text-align:left;" width="10%">临床诊断:</th>
                            <td width="90%"><p th:text="${clinicalDiagnosis}"></p></td>
                        </tr>
                        <tr>
                            <th width="10%" style="text-align:left">问题皮肤:</th>
                            <td width="90%"><p th:text="${problemSkins}"></p></td>
                        </tr>
                        <tr>
                            <th width="10%" style="text-align:left">皮肤类型:</th>
                            <td width="90%"><p th:text="${skinTypeResult}"></p></td>
                        </tr>
                        <tr>
                            <th class="t2" width="12%" style="text-align:left">皮肤年轻化:</th>
                            <td width="88%"><p th:text="${youngSkins}"></p></td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <th class="t1" colspan="6" style="text-align:right">医师签字:</th>
                <td class="t1" colspan="2"><p th:text="${username}"></p></td>
            </tr>
        </table>
        <!--分页-->
        <div th:if="${!#lists.isEmpty(courseRecordsList)}">
            <div class="PageNext">
            </div>
            <table width="800px">
                <tr>
                    <th style="text-align: right" width="20%">患者姓名:</th>
                    <td width="10%"><p th:text="${patient.name}"></p></td>
                    <td colspan="6" width="30%"></td>
                    <th width="20%">患者病历号:</th>
                    <td style="text-align: left" width="20%"><p th:text="${patient.medicalNumber}"></p></td>
                </tr>
                <tr>
                    <th style="text-align: center" colspan="10">病程记录(每次复诊时由医师记录)</th>
                </tr>
                <tr>
                    <table width="800px">
                        <tr>
                            <th width="15%" style="text-align: center">记录日期</th>
                            <th width="70%" style="text-align: center">详情</th>
                            <th width="15%" style="text-align: center">医师</th>
                        </tr>
                        <div th:each="item : ${courseRecordsList}">
                            <tr>
                                <td style="text-align: center"><p
                                        th:text="${#calendars.format(item.creationTime,'yyyy-MM-dd')}"></p></td>
                                <td style="white-space: pre-wrap;word-break:break-all;word-wrap:break-word"><p
                                        th:text="${item.content}"></p></td>
                                <td style="text-align: center"><p th:text="${item.doctor}"></p></td>
                            </tr>
                        </div>
                    </table>
                </tr>
            </table>
        </div>
        <table width="800" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td align="right">
                    <button class="noPrint" onClick="window.print()">打印</button>&nbsp;
                </td>
            </tr>
        </table>
    </div>
</div>
</body>
</html>